package com.evaluation.kexingcp.psycho.evaluation.sys.sms

import com.tencentcloudapi.common.Credential
import com.tencentcloudapi.ses.v20201002.SesClient
import com.tencentcloudapi.sms.v20210111.SmsClient
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration


@Configuration
open class SmsConfiguration {
    private val secretId = "AKIDrU4Tlpkq9OPBpphLl2GLVcbT7XpvnQDz"
    private val secretKey = "pYExYv33vcCgBYmvzrdKqFVzeEeIvUtO"
    private val region = "ap-guangzhou"
    @Bean
    open fun smsClient() : SmsClient {
        val credential = Credential(secretId, secretKey)
        val clientProfile = com.tencentcloudapi.common.profile.ClientProfile()
        clientProfile.httpProfile.endpoint = "sms.tencentcloudapi.com"
        return SmsClient(credential, region, clientProfile)
    }

    @Bean
    open fun sesClient() : SesClient {
        val credential = Credential(secretId, secretKey)
        return SesClient(credential, region)
    }
}